package com.example.todolist.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ReportMapper {
    @Select("select count(*) from report where userId=#{userId}")
    Integer countTheUserReport(Integer userId);

    @Update("update report set content=#{content} where userId=#{userId}")
    void recordWeekReport(Integer userId,String content);

    @Select("select content from report where userId=#{userId}")
    String getWeekReport(Integer userId);
    @Insert("insert into report(userId,content) VALUE(#{userId},#{content})")
    void insertWeekReport(Integer userId, String content);
}
